CREATE TABLE [dbo].[tblJSAccounts] (
	[UserID] [int] IDENTITY (1, 1) NOT NULL Primary key,
	[Email] [varchar] (50)  NOT NULL ,
	[Password] [varchar] (10)  NOT NULL ,
	[FirstName] [nvarchar] (30)  NOT NULL ,
	[LastName] [nvarchar] (30)  NOT NULL ,
	[Address] [nvarchar] (50)  NOT NULL ,
	[Resident] [nvarchar] (50)  NULL ,
	[Phone] [varchar] (50)  NULL ,
	[PhoneType] [varchar] (6)  NULL ,
	[CellPhone] [varchar] (20)  NULL ,
	[ProvinceID] [tinyint] NOT NULL ,
	[City] [nvarchar] (20)  NULL ,
	[DOB] [smalldatetime] NOT NULL ,
	[Gender] [bit] Default 0 NOT NULL ,
	[MaritalStatus] [tinyint] Default 0 NOT NULL ,
	[RaceID] [tinyint] Default 0 NOT NULL ,
	[PhotoPath] [bit] Default 0 NOT NULL ,
	[Newsletter] [bit] Default 1 NOT NULL ,
	[JobAlert] [bit] Default 1 NOT NULL ,
	[CompanyInfo] [bit] Default 1 NOT NULL ,
	[Activate] [bit] Default 0 NOT NULL ,
	[LastLogin] [smalldatetime] NOT NULL  Default getdate(),
	[ResumeActivate] [tinyint] NOT NULL ,
	[RegisterDate] [smalldatetime] NOT NULL   Default getdate(),
	[DefaultLanguage] [bit] Default 0 NOT NULL 
) 
GO

CREATE TABLE [dbo].[tblJSCoverLetters] (
	[LetterID] [int] IDENTITY (1, 1) NOT NULL Primary key,
	[UserID] [int] NOT NULL ,
	[Subject] [nvarchar] (50)  NULL ,
	[Body] [nvarchar] (500)  NULL ,
	[CreatDate] [smalldatetime] NOT NULL   Default getdate(),
	[UpdateDate] [smalldatetime] NOT NULL   Default getdate()
) 
GO

CREATE TABLE [dbo].[tblJSEducations] (
	[EducationID] [int] IDENTITY (1, 1) NOT NULL Primary key,
	[UserID] [int] NOT NULL ,
	[School] [nvarchar] (50)  NOT NULL ,
	[Country] [varchar] (15)  NOT NULL ,
	[Faculty] [nvarchar] (50)  NULL ,
	[Major] [nvarchar] (50)  NULL ,
	[Mode] [nvarchar] (20)  NULL ,
	[FromMonthYear] [char] (7)  NULL ,
	[ToMonthYear] [char] (7)  NULL ,
	[Description] [nvarchar] (100)  NULL 
) 
GO

CREATE TABLE [dbo].[tblJSExperiences] (
	[ExperienceID] [int] NOT NULL Primary key,
	[UserID] [int] NOT NULL ,
	[Company] [nvarchar] (50)  NOT NULL ,
	[Country] [varchar] (15)  NOT NULL ,
	[JobCategoryID] [tinyint] NOT NULL ,
	[JobPosition] [nvarchar] (50)  NULL ,
	[FromMonthYear] [char] (7)  NULL ,
	[ToMonthYear] [char] (7)  NULL ,
	[Salary] [nvarchar] (50)  NULL ,
	[JobSummary] [nvarchar] (100)  NULL ,
	[Description] [nvarchar] (200)  NULL 
) 
GO

CREATE TABLE [dbo].[tblJSResumes] (
	[ResumeID] [int] IDENTITY (1, 1) NOT NULL Primary key,
	[UserID] [int] NOT NULL ,
	[ResumeTitle] [varchar] (50)  NOT NULL ,
	[ContactEmail] [varchar] (50)  NOT NULL ,
	[ContactAddress] [nvarchar(50) NOT NULL,	
	[Objective] [nvarchar] (200)  NOT NULL ,
	[ExperienceYear] [tinyint] Default 0 NOT NULL ,
	[CurrentCompany] [nvarchar] (50)  NULL ,
	[RequiredFields] [bit] Default 1 NOT NULL ,
	[Activate] [bit] Default 0 NOT NULL ,	
	[Viewable] [tinyint] Default 0 NOT NULL ,
	[Confidential] bit default 1 not null
	[LastUpdateDate] [smalldatetime] NOT NULL   Default getdate(),
	[CreateDate] [smalldatetime] NOT NULL   Default getdate(),
	[SearchedHit] [tinyint] Default 0 NOT NULL ,
	[ViewedHit] [tinyint] Default 0 NOT NULL ,
	[AppliedJob] [tinyint] Default 0 NOT NULL ,
	[ContactedByCompany] [tinyint] Default 0 NOT NULL ,
	[TemplateResume] [tinyint] Default 0 NOT NULL 
) 
GO

CREATE TABLE [dbo].[tblJSReferences] (
	[ResumeID] [int] NOT NULL Primary key,
	[JobPosition] [nvarchar] (50)  NOT NULL ,	
	[JobCategoryID] [tinyint] Default 0 NOT  NULL ,
	[JobIndustryID] [tinyint] Default 0 NOT NULL ,	
	[ProvinceID] [tinyint] Default 0 NOT NULL ,
	[City] [nvarchar] (50)  NOT NULL ,
	[SalaryFrom] [int] NULL ,
	[SalaryTo] [int] NULL ,
	[Currency] [char] (3)  NULL ,
	[SalaryNegotiation] [bit] Default 0 NOT NULL ,
	[Relocate] [bit] Default 0 NOT NULL ,
	[WorkTypeID] [tinyint] Default 0 NOT NULL ,
	[ExperienceLevelID] [tinyint] Default 0 NOT NULL ,
	[Available] [tinyint] Default 1 NOT NULL ,
	[Description] [nvarchar] (200) NULL
) 
GO



CREATE TABLE [dbo].[tblJobCategories] (
	[JobCategoryID] [tinyint] NOT NULL Primary key,
	[JobCategoryName] [nvarchar] (50)  NOT NULL 
) 
GO

CREATE TABLE [dbo].[tblJobIndustries] (
	[JobIndustryID] [tinyint] NOT NULL Primary key,
	[JobIndustryName] [nvarchar] (50)  NOT NULL 
) 
GO

CREATE TABLE [dbo].[tblProvinces] (
	[ProvinceID] [tinyint] NOT NULL Primary key,
	[ProvinceName] [varchar] (20)  NOT NULL ,
	Country] [varchar] (20)  NULL
) 
GO

CREATE TABLE [dbo].[tblRCAccounts] (
	[RecruiterID] [int] IDENTITY (1, 1) NOT NULL Primary key,
	[Email] [varchar] (50)  NOT NULL ,
	[Password] [varchar] (10)  NOT NULL ,
	[CompanyName] [nvarchar] (50)  NOT NULL ,
	[EnglishName] [varchar] (50)  NULL ,
	[OpenDate] [smalldatetime] NOT NULL ,
	[ContactName] [nvarchar] (50)  NOT NULL ,
	[Address] [nvarchar] (50)  NOT NULL ,
	[ProvinceID] [tinyint] Default 0 NOT NULL ,
	[City] [nvarchar] (50)  NULL ,
	[Phone] [varchar] (20)  NOT NULL ,
	[Fax] [varchar] (10)  NULL ,
	[Logo] [bit] Default 0 NOT NULL ,
	[JobPostingBalance] [smallint] Default 10 NOT NULL ,
	[ResumeViewingBalance] [smallint] Default 10 NOT NULL ,
	[Activate] [bit] NOT NULL Default 0 ,
	[Promotion] [bit] NOT NULL Default 0 ,
	[ResumeAlert] [bit] NOT NULL Default 1 ,
	[Newsletter] [bit] NOT NULL Default 1 ,
	[Agency] [bit] NOT NULL Default 0 ,
	[PostedJobs] [int] NOT NULL Default 10 ,
	[ViewedResumes] [int] NOT NULL Default 10 ,
	[RegisterDate] [smalldatetime] NOT NULL   Default getdate(),
	[LastLogin] [smalldatetime] NOT NULL   Default getdate(),
	[DefaultLanguage] [bit] NOT NULL Default 0 
) 
GO

CREATE TABLE [dbo].[tblRCJobPostings] (
	[JobID] [int] IDENTITY (1, 1) NOT NULL Primary key,
	[RecruiterID] [int] NOT NULL ,
	[JobTitle] [nvarchar] (100)  NOT NULL ,
	[JobIndustryID] [tinyint] NOT NULL Default 0 ,
	[JobCategoryID] [tinyint] NOT NULL Default 0 ,
	[CertificateID] [tinyint] NOT NULL Default 0 ,
	[AdvName] [nvarchar] (50)  NULL ,
	[ContactEmail] [varchar] (50)  NOT NULL ,
	[ContactPerson] [nvarchar] (100)  NOT NULL ,
	[ContactTel] [varchar] (20)  NOT NULL ,
	[EnableApplyOnline] [bit] NOT NULL ,
	[City] [nvarchar] (20)  NULL ,
	[WorkLocation] [varchar] (50)  NULL ,	
	[ClosedDate] [smalldatetime] NOT NULL   Default getdate() +30,
	[JobSummary] [varchar] (100)  NOT NULL ,
	[JobNo] [varchar] (10)  NULL ,
	[RequiredNumber] [tinyint] NOT NULL Default 1 ,
	[WorkingTypeID] [tinyint] NOT NULL Default 0 ,
	[ExperienceLevelID] [tinyint] Default 0 NOT NULL ,
	[SalaryFrom] [int] NULL ,
	[SalaryTo] [int] NULL ,
	[Currency] [char] (10)  NULL ,
	[ShownSalary] [bit] NOT NULL Default 1,
	[SalaryNegotive] [bit] Default 0 NOT NULL ,
	[CompanyLogo] [bit] Default 1 NOT NULL ,
	[OnlyApplyURL] [varchar] (100)  NULL ,
	[ViewedNo] [tinyint] Default 0 NOT NULL ,
	[TemplateID] [tinyint] Default 0 NOT NULL ,
	[JobFree] [bit] NOT NULL Default 1 ,
	[PostedDate] [smalldatetime]NOT  NULL   Default getdate(),
	[UpdatedDate] [smalldatetime] NOT NULL   Default getdate(),
	[Activate] [bit] Default 0 NOT NULL 
) 
GO

CREATE TABLE [dbo].[tblRaces] (
	[RaceID] [tinyint] NOT NULL Primary key,
	[RaceName] [nvarchar] (20)  NOT NULL 
) 
GO

